export function symbolSize(value) {
  let calcSize = Math.sqrt((value[0] * 10) ** 2 + (value[1] * 10) ** 2) * 2;
  return calcSize < 10 ? 10 : calcSize
};

export function getScatterSerie(d, markLine) {
  return d.map(row => ({
    name: row[2],
    data: [row],
    symbolSize,
    type: 'scatter',
    markLine: getMarkLine(markLine),
  }))
}

const getMarkLine = (markLine) => ({
  silent: true,
  symbol: 'none',
  data: [
    {
      yAxis: markLine.yAxis,
      label: {
        show: false
      },
      lineStyle: {
        type: 'solid',
        width: 2
      }
    },
    {
      xAxis: markLine.xAxis,
      label: {
        show: false
      },
      lineStyle: {
        type: 'solid',
        width: 2
      }
    }
  ]
})